class Array
  def random
    fetch(rand(length))
  end
  
  def random_index
    rand(length)
  end
end

class Hash
  def random_key
    keys.random
  end
  
  def random_pair
    key = random_key
    [key, fetch(key)]
  end
  
  def random_value
    values.random
  end
end
